package com.inmaytide.website.controller.system;

import com.inmaytide.website.domain.entities.system.SysUser;
import com.inmaytide.website.service.system.SysUserService;
import com.inmaytide.website.utils.pagination.Pagination;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("sys/user")
public class UserController {

    @Resource
    private SysUserService service;

    @RequestMapping("list")
    @RequiresPermissions("user:view")
    public String findList(SysUser user, Pagination<SysUser> pagination, ModelMap model) {
        user.setStatus(1);
        pagination.setConditions(user);
        model.put("pagination", service.findList(pagination));
        return "sys/user/list_user";
    }

}
